home *** CD-ROM | disk | FTP | other *** search
/ Freelog 125 / Freelog_MarsAvril2015_No125.iso / Musique / Quod Libet / quodlibet-3.3.0-installer.exe / bin / json / tests / test_separators.pyc (.txt) < prev    next >
Python Compiled Bytecode  |  2014-12-31  |  2KB  |  42 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.7)
  3.  
  4. import textwrap
  5. from json.tests import PyTest, CTest
  6.  
  7. class TestSeparators(object):
  8.     
  9.     def test_separators(self):
  10.         h = [
  11.             [
  12.                 'blorpie'],
  13.             [
  14.                 'whoops'],
  15.             [],
  16.             'd-shtaeou',
  17.             'd-nthiouh',
  18.             'i-vhbjkhnth',
  19.             {
  20.                 'nifty': 87 },
  21.             {
  22.                 'field': 'yes',
  23.                 'morefield': False }]
  24.         expect = textwrap.dedent('        [\n          [\n            "blorpie"\n          ] ,\n          [\n            "whoops"\n          ] ,\n          [] ,\n          "d-shtaeou" ,\n          "d-nthiouh" ,\n          "i-vhbjkhnth" ,\n          {\n            "nifty" : 87\n          } ,\n          {\n            "field" : "yes" ,\n            "morefield" : false\n          }\n        ]')
  25.         d1 = self.dumps(h)
  26.         d2 = self.dumps(h, indent = 2, sort_keys = True, separators = (' ,', ' : '))
  27.         h1 = self.loads(d1)
  28.         h2 = self.loads(d2)
  29.         self.assertEqual(h1, h)
  30.         self.assertEqual(h2, h)
  31.         self.assertEqual(d2, expect)
  32.  
  33.  
  34.  
  35. class TestPySeparators(TestSeparators, PyTest):
  36.     pass
  37.  
  38.  
  39. class TestCSeparators(TestSeparators, CTest):
  40.     pass
  41.  
  42.